package de.keychain

import org.codehaus.groovy.grails.plugins.codecs.SHA256Codec;

import grails.rest.Resource


@Resource(uri='/passwords', formats=['json'])
class Password {

	String password
	Date expires = new Date()
	Boolean enabled = true
	
    static constraints = {
		
    }
	
	static belongsTo = [ServiceModel]
	
	
	def encodePassword(){
		if(this.password){
			this.password = SHA256Codec.encode(this.password)
		}
	}
}
